﻿Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Seuss.EnterpriseLibrary.DataAccess
Imports Seuss.EnterpriseLibrary.BusinessLogic
Imports System.Web
Imports System.Data

Partial Class Consulta_PA_AsuntosEstudiantiles_Det
    Inherits System.Web.UI.Page
    Dim cPerCodigo As String
    Dim nUniOrgCodigo As Integer

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        cPerCodigo = Request.QueryString("cPerCodigo")
        nUniOrgCodigo = Request.QueryString("nUniOrgCodigo")
        Response.Expires = -1
        Response.AddHeader("Pragma", "no-cache")
        Response.AddHeader("cache-control", "private")
        Response.CacheControl = "no-cache"
        If Not Page.IsPostBack Then
            lblcPercodigo.Text = cPerCodigo
            lblnUniOrgCodigo.Text = nUniOrgCodigo
            Call CargarServicios(lblnUniOrgCodigo.Text)
            Using Seguridad As New BLL_Administracion
                Seguridad.Set_Transaccion_Insert(Nothing, 100401, IdentityUser.UserCode, My.Request.UserHostAddress.ToString, CrearXMLTransaccion("Consulta Pagina Movil", "/Pagina|" + My.Request.Url.Segments(My.Request.Url.Segments.Length - 1).ToString))
            End Using
        End If
    End Sub

    Private Sub CargarServicios(ByVal nUniOrgCodigo As Integer)
        Dim ldr As New List(Of IDataReader)
        Dim salto_linea As String = Chr(13) + Chr(10)
        Dim empieza_carreras As String = "<ul>" + salto_linea
        Dim centro_carreras As String = ""        
        Dim carrera_codigo As String = ""

        Using ObjPool As New PoolDbCommand()
            Dim ObjUsuario As New DAL_Kiosco(ObjPool.Database)
            ObjPool.AddDbCommand(ObjUsuario.Get_ServiciosUniversitarios_By_nUniOrgCodigo(nUniOrgCodigo, "01010303"), PoolDbCommand.PoolDbCommandResultType.Query)
            ObjPool.Pooling(Nothing, ldr, True)
            ObjUsuario = Nothing
            While ldr(0).Read
                carrera_codigo = ldr(0).Item("cIntDescripcion").ToString 'carrerasrd.Item("cIntDescripcion")
                carrera_codigo = Replace(carrera_codigo, "servicios_universitarios.aspx?nUniOrgCodigo=", "")
                centro_carreras = centro_carreras + "<li><a href='./PA_AsuntosEstudiantiles_Contenido.aspx?nUniOrgCodigo=" + carrera_codigo + "&cPerJuridica=" + nUniOrgCodigo.ToString + "&cPerCodigo=" + lblcPercodigo.Text + "'>" + ldr(0).Item("cIntNombre").ToString + "<span></span></a></li>" + salto_linea
               
            End While
        End Using
        LabelCarreras.Text = empieza_carreras + centro_carreras
    End Sub
End Class
